#ifndef VECTOR2D_HPP
#define VECTOR2D_HPP
#include <iostream>

class Vector2D
{
private:
  double mX, mY;
  double mMagnitude;
  void setMagnitude();
public:
  Vector2D();
  Vector2D(double x, double y);
  ~Vector2D();
  double getX() const { return mX; }
  double getY() const { return mY; }
  double getMagnitude() const { return mMagnitude; }
  const Vector2D unit() const;
  const Vector2D normal() const;
  double getAngle(Vector2D& v) const;
  const Vector2D operator+(const Vector2D& v) const;
  const Vector2D operator-(const Vector2D& v) const;
  double operator*(const Vector2D& v) const;
  const Vector2D operator*(double k) const;
};

std::ostream& operator<<(std::ostream& os, const Vector2D& v);
Vector2D operator*(double k, const Vector2D& v);

#endif // VECTOR2D_HPP
